Implementation of APCUPSD Addon#372
Conversation
| ) | ||
|
|
||
| // Constants | ||
| const ( |
There was a problem hiding this comment.
These docker images are provided by third parties.
Please let me know if in your estimation there is a security risk here and if these images need to be audited.
|
|
||
| // Get the parameters | ||
| enabledParam := configPage.addon.GetEnabledParameter() | ||
| // TODO: Don't like how I reference these by index here. Is there a better way? |
There was a problem hiding this comment.
Any suggestion for a cleaner way to fetch these parameters? It seems I can only access functions as defined by the generic addon interface.
| configPage.handleDraw() | ||
| } | ||
|
|
||
| func (configPage *AddonApcupsdPage) handleDraw() { |
There was a problem hiding this comment.
Please review my understanding of how form items should be drawn.
| addonsPage.gwwPage, | ||
| } | ||
|
|
||
| // TODO: Make this respond to uncommitted config changes |
There was a problem hiding this comment.
Currently the addon only appears/disappears once you have save your changes to the "MetricsEnabled" setting. Is there a way to fetch the current uncommitted state of the config?
|
|
||
| var containerContents []byte | ||
|
|
||
| if apcupsdMode.Value == apcupsd.Mode_Network { |
There was a problem hiding this comment.
This is perhaps a bit novel as I conditionally choose which compose file to use based on the users preference on how to run APCUPSD. I've tested and the smartnode seems to create and destroy the services correctly when toggling between the two different setups.
|
|
||
| // Write config file | ||
| if apcupsdMode.Value == apcupsd.Mode_Container { | ||
| // TODO: Confirm this is a good location for a generic config file (i.e. not a container file) |
There was a problem hiding this comment.
I arbitrarily chose the location to write the apcupsd.conf file. Please let me know if there is a preferred location for templates and configuration files.
This PR contains changes to the smartnode to implement the APCUPSD addon proposed in GA022303.
When a user has metrics enabled, this addon allows a node operator to:
This PR must be accepted alongside the PR to the smartnode-install repository.